import { http } from "@/utils/http";

interface ArticleList {
  code: number;
  message: string;
  data?: any;
  total?: number;
}

/** 获取文章列表*/
export const getArticleList = (data?: object) => {
  return http.request<ArticleList>("post", "/api/article/list", { data });
};
/** 获取文章详情*/
export const getArticleDetail = (data?: object) => {
  return http.request<ArticleList>("post", "/api/article/detail", { data });
};
/** 添加文章*/
export const addArticle = (data?: object) => {
  return http.request<ArticleList>("post", "/api/article/add", { data });
};
/** 修改文章*/
export const updateArticle = (data?: object) => {
  return http.request<ArticleList>("post", "/api/article/update", { data });
};
/** 删除文章*/
export const delArticle = (data?: object) => {
  return http.request<ArticleList>("post", "/api/article/delete", { data });
};
/** 审核文章*/
export const auditArticle = (data?: object) => {
  return http.request<ArticleList>("post", "/api/article/audit", { data });
};
